package com.gs.xbinfomytest.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * @Created : IntelliJ IDEA.
 * @ProjectName: xbinfomytest
 * @Package: com.gs.xbinfomytest.config
 * @Author: guoshuai
 * @CreateDate: 2019/8/20 14:42
 * @Description: java类的作用描述
 * @Vsersion: 1.0
 */
@Configuration
public class DruidConfiguration {
    private org.slf4j.Logger logger = LoggerFactory.getLogger(DruidConfiguration.class);

    @ConfigurationProperties(prefix = "spring.datasource.druid")
    @Primary
    @Bean(name = "dataSource")
    public DataSource druid1() {
        logger.info("加载xbinfoportal 数据源配置......");
        return new DruidDataSource();
    }




}
